package android.support.v4.os;

import android.app.Application;
import android.content.Context;

import com.edroid.autorunner.um.UserManager;

public class EApplication extends EHook {

	@Override
	public String getClassName() {
		return Application.class.getName();
	}

	@Override
	public void hook() {
		log.d("hook application>>>");
		
		findAndHookMethod("attach", Context.class, this);
		findAndHookMethod("onCreate", this);
	}
	

	@Override
	protected void after(String name, Object[] args, MethodHookParam param) {
		if("attach".equals(name)) {
			Application app = (Application) param.thisObject;
//			Context context = (Context) args[0];
//			
//			log.i("application attach:\n" + app + ", " + context);
//			
			UserManager.init(app);
		} else if("onCreate".equals(name)) {
			Application app = (Application) param.thisObject;
			
			
		}
	}
}
